/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fait.ferm.ui;

import fait.ferm.ui.tables.TaxesPayRow;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.control.TableView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;

/**
 *
 * @author alex
 */
public class PlanTabParentPaneController  implements Initializable {
	
	@FXML
	private TabPane tabPane;
	@FXML
	private Tab controlTab;
	@FXML
	private Tab feedTab;
	@FXML
	private Tab payTab;
	@FXML
	private Tab purchaseTab;
	@FXML
	private BorderPane feedPane;
	@FXML
	private AnchorPane controlPane;
	
	/**
	 * Initializes the controller class.
	 * 
	 * @param url 
	 * @param rb 
	 */
	@Override
	public void initialize(URL url, ResourceBundle rb) {
		try {
			//		final ChangeListener changeListener = new ChangeListener() {
			//			@Override
			//			public void changed(ObservableValue ov, Object old, Object newVal) {
			//				System.out.println("Cur Index is " + newVal.toString());
			//			}
			//		tabPane.selectionModelProperty().get().selectedIndexProperty().addListener(changeListener);
			//		tabPane.selectionModelProperty().get().selectedIndexProperty().addListener(changeListener);

			controlTab.contentProperty().set((AnchorPane) FXMLLoader.load(getClass().getResource("PlanTabControlPane.fxml")));
			feedTab.contentProperty().set((BorderPane) FXMLLoader.load(getClass().getResource("PlanTabFeedingPane.fxml")));
			payTab.contentProperty().set((BorderPane) FXMLLoader.load(getClass().getResource("PlanTabPayPane.fxml")));
			purchaseTab.contentProperty().set((BorderPane) FXMLLoader.load(getClass().getResource("PlanTabPurchasePane.fxml")));
			
			//controlPane.getChildren().add( );
//			feedPane = (AnchorPane) FXMLLoader.load(getClass().getResource("PlanTabFeedPane.fxml"));
					//Controltab. .getChildren().add(p);
		} catch (IOException ex) {
			Logger.getLogger(PlanTabParentPaneController.class.getName()).log(Level.SEVERE, null, ex);
		}

	}	
	
	
}
